<template>
  <view class="page-guide">
    <view class="header">
      <img src="~@/static/images/login/login-icon.png" alt="" srcset="" class="info-logo" />
      <view class="countdown" @click="handleGoIndex">{{ countdown }} {{ $t('guide.跳过') }}</view>
    </view>
    <view class="info">
      <view class="text-b">{{ $t('guide.医疗美容医院') }}</view>
      <view class="text-s">{{ $t('guide.专业科学互联网平台') }}</view>
    </view>
    <view class="btn" @click="handleGoIndex">{{ $t('guide.点击进入首页') }}</view>
  </view>
</template>
<script>
  export default {
    data() {
      return {
        countdown: 5
      }
    },
    methods: {
      // 跳转首页
      handleGoIndex() {
        this.$tab.reLaunch(`/pages/index`)
      }
    },
    created() {
      this.timer = setInterval(() => {
        this.countdown--
        if (this.countdown === 0) {
          clearInterval(this.timer)
          this.handleGoIndex()
        }
      }, 1000)
    },
    destroyed() {
      clearInterval(this.timer)
    }
  }
</script>
<style scoped lang="scss">
  .page-guide {
    width: 100%;
    height: 100vh;
    background: url(~@/static/images/guide/guide-bg.jpg) 0% 0% / 100% 100vh no-repeat;
    overflow: hidden;
    position: relative;
    .header {
      position: absolute;
      top: 78rpx;
      width: 100vw;
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 0 36px;
      .info-logo {
        width: 120rpx;
        height: 120rpx;
      }
      .countdown {
        padding: 0 40rpx;
        height: 70rpx;
        line-height: 70rpx;
        background: #ffffff;
        border-radius: 210rpx 210rpx 210rpx 210rpx;
        opacity: 0.7;
      }
    }
    .info {
      position: absolute;
      top: 65%;
      width: 100vw;
      display: flex;
      flex-direction: column;
      justify-content: center;
      align-items: center;
      .text-b {
        font-size: 60rpx;
        color: #fff;

        text-align: center;
        margin-bottom: 20rpx;
      }
      .text-s {
        font-size: 32rpx;
        color: #fff;
      }
    }
    .btn {
      position: absolute;
      top: calc(70% + 185rpx);
      width: 80%;
      left: 50%;
      transform: translateX(-50%);
      background-color: #fff;
      color: #3d3d3d;
      height: 100rpx;
      line-height: 100rpx;
      text-align: center;
      border-radius: 293rpx 293rpx 293rpx 293rpx;
    }
  }
</style>
